//轮播
			var rotation=document.getElementsByClassName("rotation")[0];
			var imgs=rotation.getElementsByTagName("img");
			var j=0;
			timer=setInterval(function(){
				j++;
				j==3&&(j=0);
				for(var i=0;i<imgs.length;i++){		
					imgs[i].className="";
				}
				imgs[j].className="active";
			},2000);
		
		//切换小三角
		var libaba=document.getElementsByClassName("li_baba")[0];
		var picsan=libaba.getElementsByTagName("img");
		libaba.onmouseover=function(){
			picsan[0].className="";
			picsan[1].className="ok";
		}
		libaba.onmouseout=function(){
			picsan[1].className="";
			picsan[0].className="ok";
		}
		
		
		//弹出隐私条例
		var agree=document.getElementsByClassName("agree")[0];
		var yinsisan=agree.getElementsByTagName("img");
		var yinsi=document.getElementsByClassName("yinsi")[0];
		var num=0;
		for(var m=0;m<yinsisan.length;m++){
			yinsisan[m].onclick=function(){
				num++;
				if(num%2==1){
					yinsisan[1].className="okk";
					yinsisan[0].className="";
					yinsi.style.display="block";
				}else{
					yinsisan[0].className="okk";
					yinsisan[1].className="";
					yinsi.style.display="none";
				}
			}
		}
		
		//input的正则
		var inputs=document.getElementsByTagName("input");
		var passtxt=document.getElementsByClassName("passtxt")[0];
		var namedui=document.getElementsByClassName("duione")[0];
		var pwddui=document.getElementsByClassName("duitwo")[0];
		var phonedui=document.getElementsByClassName("duithree")[0];
		var yanzhengdui=document.getElementsByClassName("duifour")[0];
		var registerform=document.getElementsByClassName("QQform")[0];
		for(var k=0;k<inputs.length-1;k++){
			inputs[k].onfocus=function(){
				if(this.name=="username"){
//					console.log(1);
					this.style.borderColor="#549df8";
					this.nextElementSibling.style.display="none";
				}else if(this.name=="pwd"){
//					console.log(1);
					passtxt.style.display="block";
					this.style.borderColor="#549df8";
					this.nextElementSibling.style.display="none";			
					
				}else if(this.name=="phone"){
//					console.log(1);
					this.nextElementSibling.style.display="none";
					this.style.borderColor="#549df8";
				}else if(this.name=="yanzhengma1"){
//					console.log(1);
					this.nextElementSibling.style.display="none";
					this.style.borderColor="#549df8";
				}
			}
			
			
			inputs[k].oninput=function(){
				if(this.name=="pwd"){
					var wordtxt=document.getElementsByClassName("wordtxt");
					var reg1=/\s/;
					var reg2=/^[0-9A-Za-z~!@#$%^&*()?\s]{8,16}$/;
					var reg3=/^(?![A-Za-z]+$)(?![0-9]+$)(?![~!@#$%^&*()?]+$)[0-9A-Za-z~!@#$%^&*()?]{2,}$/;
					
					if(!reg1.test(this.value)){
						wordtxt[0].innerHTML="√";
						wordtxt[0].style.background="#44e86c";
						wordtxt[0].parentNode.style.color="#000";
					}else{
						wordtxt[0].innerHTML="!";	
						wordtxt[0].style.background="#a4c9ff";
						
					}
					
					if(reg2.test(this.value)){
						wordtxt[1].innerHTML="√";
						wordtxt[1].style.background="#44e86c";
						wordtxt[1].parentNode.style.color="#000";
					}else{
						wordtxt[1].innerHTML="!";
						wordtxt[1].style.background="#a4c9ff";
						
					}
					
					if(reg3.test(this.value)){
						wordtxt[2].innerHTML="√";
						wordtxt[2].style.background="#44e86c";
						wordtxt[2].parentNode.style.color="#000";
					}else{
						wordtxt[2].innerHTML="!";
						wordtxt[2].style.background="#a4c9ff";
						
					}
				}
			}
			
			
			inputs[k].onblur=function(){
				if(this.name=="username"){
//					var namedui=document.getElementsByClassName("duione")[0];
					if(this.value==""){
						this.nextElementSibling.style.display="block";
						this.style.borderColor="#ff5b5b";
						
						namedui.style.display="none";
					}else{
						namedui.style.display="block";
					}
					
				}else if(this.name=="pwd"){
//					var pwddui=document.getElementsByClassName("duitwo")[0];
					var wordtxt=document.getElementsByClassName("wordtxt");
					var passtxt=document.getElementsByClassName("passtxt")[0];
					var reg1=/\s/;
					var reg2=/^[0-9A-Za-z~!@#$%^&*()?\s]{8,16}$/;
					var reg3=/^(?![A-Za-z]+$)(?![0-9]+$)(?![~!@#$%^&*()?]+$)[0-9A-Za-z~!@#$%^&*()?]{2,}$/;
					if(this.value==""){
						passtxt.style.display="none";
						this.nextElementSibling.style.display="block";
						this.style.borderColor="#ff5b5b";
						
						pwddui.style.display="none";
					}else{
						pwddui.style.display="block";
					}
					
					if(reg1.test(this.value)){
						wordtxt[0].innerHTML="!";	
						wordtxt[0].style.background="#ff5b5b";	
						wordtxt[0].parentNode.style.color="#ff5b5b";
						this.style.borderColor="#ff5b5b";
						pwddui.style.display="none";
						wordtxt[1].style.display="none";
						wordtxt[2].style.display="none";
						wordtxt[1].parentNode.style.display="none";
						wordtxt[2].parentNode.style.display="none";
					}else{
						wordtxt[0].parentNode.style.color="#000";
					}
					
					if(!reg2.test(this.value)){
						wordtxt[1].innerHTML="!";	
						wordtxt[1].style.background="#ff5b5b";	
						wordtxt[1].parentNode.style.color="#ff5b5b";
						this.style.borderColor="#ff5b5b";
						pwddui.style.display="none";
						wordtxt[0].style.display="none";
						wordtxt[2].style.display="none";
						wordtxt[0].parentNode.style.display="none";
						wordtxt[2].parentNode.style.display="none";
					}else{
						wordtxt[1].parentNode.style.color="#000";
					}
					
					if(!reg3.test(this.value)){
						wordtxt[2].innerHTML="!";	
						wordtxt[2].style.background="#ff5b5b";	
						wordtxt[2].parentNode.style.color="#ff5b5b";
						this.style.borderColor="#ff5b5b";
						pwddui.style.display="none";
						wordtxt[0].style.display="none";
						wordtxt[1].style.display="none";
						wordtxt[0].parentNode.style.display="none";
						wordtxt[1].parentNode.style.display="none";
					}else{
						wordtxt[2].parentNode.style.color="#000";
					}
					if(pwddui.style.display=="block"){
						passtxt.style.display="none";
					}
					
				}
				
				else if(this.name=="phone"){
					var reg=/^(\+86|0086)?\s*1[3-9]\d{9}$/;
//					var phonedui=document.getElementsByClassName("duithree")[0];
					if(this.value==""){
						this.nextElementSibling.style.display="block";
						this.style.borderColor="#ff5b5b";
					}
					
					if(reg.test(this.value)){
						phonedui.style.display="block";
					}else{
						this.nextElementSibling.innerHTML="请输入正确格式的手机号";
						this.nextElementSibling.style.display="block";
						phonedui.style.display="none";
						this.style.borderColor="#ff5b5b";
					}
					
				}else if(this.name=="yanzhengma1"){
					var yanzhengmas=document.getElementsByClassName("yanzhengma2")[0];
					var arr=[];
					var wrong=document.getElementsByClassName("yanzhengx")[0];
//					var yanzhengdui=document.getElementsByClassName("duifour")[0];
					if(this.value==""){
						this.nextElementSibling.style.display="block";
						this.style.borderColor="#ff5b5b";
						wrong.style.display="none";
					}
					
					
					yanzhengmas.onclick=function(){
						for(var i=48;i<=57;i++){
							arr.push(String.fromCharCode(i));
						}
						for(var i=65;i<=90;i++){
							arr.push(String.fromCharCode(i));
						}
						for(var i=97;i<=122;i++){
							arr.push(String.fromCharCode(i));
						}
						
						for(var j=0,str="";j<4;j++){
							var r=parseInt(Math.random()*(arr.length));
							str+=arr[r];
						}
						
						yanzhengmas.firstElementChild.innerHTML=str;
//						console.log(str);
					}
					if(this.value.toUpperCase()==yanzhengmas.firstElementChild.innerHTML.toUpperCase()){
							yanzhengdui.style.display="block";
							wrong.style.display="none";
					}else if(this.value==""){
						    wrong.style.display="none";
							yanzhengdui.style.display="none";
					}else{
						wrong.style.display="block";
						yanzhengdui.style.display="none";
						this.style.borderColor="#ff5b5b";
					}
				}
			}
		}
		

		
//		registerform.onsubmit=function(){
//			if((namedui.style.display=="none")||(pwddui.style.display=="none")||(phonedui.style.display=="none")||(yanzhengdui.style.display=="none")){
//				return false;
//			}
//			
//		}

		registerform.onsubmit=function(){
			for(var m=0;m<inputs.length-1;m++){
				inputs[m].onblur();
				if(inputs[m].style.borderColor=="rgb(255, 91, 91)"){
					console.log(1);
					return false;
				}
			}
		}
		
		
		
		
		